package com.kk.strategy.strategy;

public abstract class BaseDuck {

    protected IFly flyBehavior;

    private String duckName;

    public BaseDuck(String duckName) {
        this.duckName = duckName;
    }

    public void quack() {
        System.out.println(duckName + " 鸭子叫");
    }

    public void swim() {
        System.out.println(duckName + " 鸭子游泳");
    }

    public void fly() {
        flyBehavior.fly(duckName);
    }
}
